'use strict'
import React, { Component, PropTypes } from 'react'



class Recommend extends Component {


    constructor(){
        super()
        this.state  = {
            recommends :[]
        }
    }

    componentWillMount() {

        $.ajax({
            url: '../../webapp/data/productList.json',
            // data: {categoryId:categoryId},
            type: 'GET',
            dataType: 'json',
            success: (response) => {
                this.setState({
                    recommends:response
                })

            }
        });


    }



	render(){

    	const recommends = this.state.recommends;

		return(

			<div id="recommendWrap" className="recommendWrap">
				<div className="list-recommend">
					<div>
						<div className="recommend-title">为你推荐</div>

						<div className="recommend-list">
							<ul>


								{
                                    recommends.map(function(item,index){

                                    	return(

											<li className="J_linksign-customize">
												<a className="exposure" href="/#/product/view?product_id=5319">
													<div className="img"><img className="lazy" src={item.imgUrl} style={{'transform-origin': '0px 0px 0px', opacity: 1, 'transform': 'scale(1, 1)'}}/>

													</div>
													<div className="recommend-info">
														<div className="recommend-name">{item.title}</div>
														<div className="recommend-price">{item.price}

														</div>
													</div>
												</a>
											</li>

										)

									})
								}


							</ul>
						</div>

					</div>

				</div>

			</div>


    )
	}
}
export default Recommend